#sing @echo off & SetLocal EnableDelayedExpansion
#newl set container=m4a|#newl set container=mp3|#newl set container=oga|#newl set container=mka|#newl set container=aac|#newl set container=flac|#newl set container=opus|#newl set container=wav|#newl set container=mp2|#newl set container=ogg|#newl set container=mkv|#newl set container=mp4|--select container--
#newl set tempfile=#path#name-temp-csv.txt
#newl "#ppthapps\ffmpeg\ffprobe.exe" -i "#item" -print_format csv -sexagesimal -show_chapters > "%tempfile%"
#newl
#newl FOR /F "usebackq tokens=5,7,* delims=," %%a in ("%tempfile%") do (
#newl set title=%%c
#newl set title=!title:"=!
#newl set title=!title::=,!
#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -c:a copy -vn -ss %%a -to %%b "#path!title!.%container%"|#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -b:a 64k -vn -ss %%a -to %%b "#path!title!.%container%"|#newl "#ppthapps\ffmpeg\ffmpeg.exe" -i "#item" -c:a opus -b:a 24k -vn -ss %%a -to %%b "#path!title!.%container%"|--select bitrate--
#newl )
#newl del "%tempfile%"

<comment>
Parse m4b file, and extract audio chapters to single files.
Default output container is m4a (mp4/aac audio).
You can also change bitrate, or codec and bitrate, by changing last line in the script.
